package cn.ecut;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class jdbc2 {
    public static void main(String[] args) throws Exception{
        Class.forName("com.mysql.cj.jdbc.Driver") ;
        String url = "jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai" ;
        String username = "root" ;
        String password = "" ;
        Connection connection = DriverManager.getConnection(url , username , password ) ;
        Statement statement = connection.createStatement() ;
        // 删除
        //String SQL = "delete from one where name='6' " ;
        //修改
        String SQL="update one set name='e' where id =1;";
        int executeUpdate = statement.executeUpdate(SQL);
        System.out.println( executeUpdate );
        System.out.println( connection.getAutoCommit() );
        statement.close();
        connection.close();
    }
}
